#pragma once
#include<stdio.h>
#include<stdlib.h>
#include<assert.h>
#include<stdbool.h>

#define INIT_CAPACITY 4
typedef int dataType;
typedef struct Heap
{
	dataType* a;
	int size;
	int capacity;
}heap;

void initHeap(heap* pheap);
void destroyedHeap(heap* pheap);
void pushHeap(heap* pheap, dataType x);
void popHeap(heap* pheap);
dataType topHeap(heap* pheap);
int sizeHeap(heap* pheap);
bool isEmpty(heap* pheap);
void adjustUp(dataType* a, int child);
int getMax(dataType* a, int x, int y);
void adjustDown(dataType* a, int parent, int size);